<?php 
$show_validator = true;
include TMPL_PATH.'public/header.phtml';
?>
<script type="text/javascript" src="/statics/xheditor/xheditor-zh-cn.min.js"></script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='<?php echo U('article/page_list');?>' ><em>单页列表</em></a><span>|</span><a href='javascript:;' class="on"><em>编辑单页</em></a></div>
</div>
<script type="text/javascript"> 
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		<?php 
				//if(isset($languageList) && $languageList):
				//	foreach ($languageList as $language_id => $language_name):
			?>
				//	var language_name = "<? echo $language_name; ?>";
				//	var language_id = <?php echo $language_id;?>;
				//	$("#name_"+language_id).formValidator({onshow:"请输入单页"+language_name+"名称",onfocus:"请输入单页"+language_name+"名称",oncorrect:"输入正确"}).inputValidator({min:2,onerror:"请输入单页"+language_name+"名称"});
					$("#name_1").formValidator({onshow:"请输入单页名称",onfocus:"请输入单页名称",oncorrect:"输入正确"}).inputValidator({min:2,onerror:"请输入单页名称"});
					<?php 
			//	endforeach;
		//	endif;
		?>
	});

//-->
</script>
<style type='text/css'>
.pic {
    float: left;
    margin-right: 10px;
    text-align: center;
}
.pic img {
    border: 3px solid #EFEFED;
    cursor: pointer;
}
.pic img.current {
    border: 3px solid #FF6600;
}
</style>
<form name="myform" id="myform" action="__SELF__" method="post" enctype="multipart/form-data">
<div class="pad-10">
<div class="col-tab">
	<ul class="tabBut cu-li">
		<?php 
$langCount = 0;
if(isset($languageList) && $languageList){
		$langCount = count($languageList);
}
$langCount++;
?>
<?php 
	if(isset($languageList) && $languageList):
		$i = 0;
		foreach ($languageList as $language_id => $language_name):
			$i++;
	?>
<li id="tab_setting_<?php echo $i;?>" <?php if($i==1) echo'class="on"';?> onclick="SwapTab('setting','on','',<?php echo $langCount;?>,<?php echo $i;?>);"><?php echo $language_name;?></li>
<?php 
		endforeach;
	endif;
	?>
<li id="tab_setting_<?php echo $langCount;?>" onclick="SwapTab('setting','on','',<?php echo $langCount;?>,<?php echo $langCount;?>);">基本选项</li>
	</ul>
</div>
<?php 
	if(isset($languageList) && $languageList):
		$i = 0;
		foreach ($languageList as $language_id => $language_name):
			$i++;
?>
<div id="div_setting_<?php echo $i;?>" class="contentList pad-10 <?php if($i>1)echo'hidden';?>">
	<table width="100%" class="table_form ">
		<tr>
        <th width="120">单页名称：</th>
        <td><input type="text" name="article[<?php echo $language_id;?>][name]" id="name_<?php echo $language_id;?>" class="input-text" size='60' value="<?php echo isset($page['items'][$language_id]['name']) ? $page['items'][$language_id]['name'] : null;?>"/></td>
      </tr>
			<tr class="hidden">
        <th>摘要：</th>
        <td>
					<textarea name="article[<?php echo $language_id;?>][summary]" style="width:80%;height:46px;"><?php echo isset($page['items'][$language_id]['summary']) ? $page['items'][$language_id]['summary'] : null;?></textarea>
				</td>
      </tr>
			<tr>
        <th>描述：</th>
        <td>
					<textarea name="article[<?php echo $language_id;?>][description]" class="editor"><?php echo isset($page['items'][$language_id]['description']) ? $page['items'][$language_id]['description'] : null;?></textarea>
				</td>
      </tr>
      <tr>
	      <th>网页标题：</th>
	      <td><input name='article[<?php echo $language_id;?>][meta_title]' type='text' value='<?php echo isset($page['items'][$language_id]['meta_title']) ? $page['items'][$language_id]['meta_title'] : null;?>' style="width:50%;"><div class="infoShow">针对搜索引擎设置的标题</div></td>
    </tr>
    <tr>
      <th>网页关键词：</th>
      <td><textarea name='article[<?php echo $language_id;?>][meta_keywords]' style="width:50%;height:40px"><?php echo isset($page['items'][$language_id]['meta_keywords']) ? $page['items'][$language_id]['meta_keywords'] : null;?></textarea><div class="infoShow">关键字中间用半角逗号隔开</div></td>
    </tr>
    <tr>
      <th>网页描述：</th>
      <td><textarea name='article[<?php echo $language_id;?>][meta_description]' style="width:50%;height:50px"><?php echo isset($page['items'][$language_id]['meta_description']) ? $page['items'][$language_id]['meta_description'] : null;?></textarea><div class="infoShow">针对搜索引擎设置的网页描述</div></td>
    </tr>
   </table>
</div>
<?php 
		endforeach;
	endif;
	?>
<div id="div_setting_<?php echo $langCount;?>" class="contentList pad-10 hidden">
<table width="100%" class="table_form ">
      <tr class="hidden">
        <th width="120">页面别名：</th>
        <td><input type="text" name="path_alias" id="path_alias" class="input-text" value="<?php echo $page['path_alias'];?>"/> <div class="infoShow">地址栏中展示的URL别名</div></td>
      </tr>
			<tr>
      <tr style="display:none">
        <th>页面模板：</th>
        <td><input type="text" name="template" id="template" class="input-text" value="<?php echo isset($page['template']) ? $page['template'] : null;?>"/> <div class="infoShow">该单页使用的模板名称，不填为系统默认的模板</div></td>
      </tr>
			<tr>
        <th width="120">排序：</th>
        <td><input type="text" name="listorder" id="listorder" class="input-text" size="5" value="<?php echo isset($page['listorder']) ? $page['listorder'] : null;?>"/></td>
      </tr>
      <tr>
	     <th>发布：</th>
	      <td>
		  <input type='radio' name='display' value='1' <?php if(!isset($page['display']) || (isset($page['display']) && $page['display']==1))echo 'checked';?>> 是&nbsp;&nbsp;&nbsp;&nbsp;
		  <input type='radio' name='display' value='0' <?php if(isset($page['display']) && $page['display']==0)echo 'checked';?> > 否</td>
    </tr>
   </table>
</div>
 <div class="bk15"></div>
    <input name="dosubmit" type="submit" class="button" value="提交" class="button">
</div>
</form>
</body>
</html>